body {
    position: relative;
    overflow: hidden;
    background: #fff; /* 兜底色，防止渐变没加载时闪白 */
    font-family: '微软雅黑', 'Arial', sans-serif;
    text-align: center;
    margin: 0;
    padding: 0;
}

h1 {
    margin-top: 20px;
    color: #e06666;
    letter-spacing: 4px;
}

#game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 10px;
}

  #game-canvas {
      background: #fff;
      border-radius: 20px;
      box-shadow: 0 4px 24px rgba(0,0,0,0.08);
      margin-bottom: 10px;
  }

#message {
    font-size: 1.3em;
    color: #ff9800;
    margin-top: 10px;
    min-height: 2em;
    font-weight: bold;
    transition: opacity 0.5s;
}

img.fruit {
    border-radius: 50%;
    object-fit: cover;
}

#rules {
    background: rgba(255,255,255,0.8);
    display: inline-block;
    margin: 10px auto 20px auto;
    padding: 10px 24px;
    border-radius: 12px;
    color: #b94a48;
    font-size: 1em;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    text-align: left;
}
#rules ul {
    margin: 0;
    padding-left: 20px;
}
#rules li {
    margin-bottom: 4px;
}

body::before {
    content: "";
    position: fixed;
    left: 0; top: 0; right: 0; bottom: 0;
    z-index: -1;
    background: linear-gradient(120deg, #ffe4ec, #fffbe7, #ffe5b4, #f3e6ff, #ffe4ec);
    background-size: 400% 400%;
    animation: gradientMove 30s ease-in-out infinite;
    opacity: 1;
    pointer-events: none;
}

@keyframes gradientMove {
    0% {
        background: linear-gradient(120deg, #ffe4ec, #fffbe7, #ffe5b4, #f3e6ff, #ffe4ec); /* 暖色 */
        background-size: 400% 400%;
        background-position: 0% 50%;
    }
    50% {
        background: linear-gradient(120deg, #e0f7fa, #e6ffe6, #b3e5fc, #f3e6ff, #e0f7fa); /* 冷色 */
        background-size: 400% 400%;
        background-position: 100% 50%;
    }
    100% {
        background: linear-gradient(120deg, #ffe4ec, #fffbe7, #ffe5b4, #f3e6ff, #ffe4ec); /* 回到暖色 */
        background-size: 400% 400%;
        background-position: 0% 50%;
    }
}
